# -*- encoding: utf-8 -*-
# @File    :   user.py
# @Time    :   2021/07/23 10:20:18
# @Author  :   wudongmin
# @Contact :   wudongmin@xroom.net
# @version   :  1.0

from . import Base, TimestampMixin
from sqlalchemy import Column, Integer, String, ForeignKey


class User(Base, TimestampMixin):
    __tablename__ = 'users'
    id = Column(Integer, primary_key=True, autoincrement=True)
    name = Column(String(50), comment="姓名")
    age = Column(Integer, comment="年龄")
    sex = Column(String(10), comment="性别")


class Student(Base, TimestampMixin):
    __tablename__ = 'students'
    id = Column(Integer, primary_key=True, autoincrement=True)
    user_id = Column(Integer, ForeignKey("users.id"))
    score = Column(Integer)
    description = Column(String(255), comment="学生描述")
